package com.carefree.system.modules.admin.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.carefree.common.valid.AddGroup;
import com.carefree.common.valid.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;
import java.util.Date;


/**
 * 用户角色关联
 *
 * @author tengbin
 */
@Data
@TableName("sys_user_role")
public class UserRoleEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @NotNull(message = "修改必须指定主键id", groups = {UpdateGroup.class})
    @Null(message = "新增不能指定主键id", groups = {AddGroup.class})
    @TableId
    private Long id;
    /**
     * 角色id
     */
    private Long roleId;
    /**
     * 用户id
     */
    private Long userId;
    /**
     * 创建人
     */
    private Long creator;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新时间
     */
    private Date updateTime;
    /**
     * 删除标记（0:可用 1:已删除）
     */
    private Integer isDeleted;

}
